package com.zlj.xialiao.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author 郑霖俊
 * @create 2021-05-24 8:41
 * 处理整个web异常
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionHandle {

    @ExceptionHandler(ArithmeticException.class)//处理异常
    public String handlerException(ArithmeticException e){
        log.error("异常是{}",e);
        return "login";
    }
}
